<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app"></div>
    <script src="https://unpkg.com/vue@next"></script>

    <template id="huyong">
        <div>
            <h2>{{count}}</h2>
            <button @click='increment'>+</button>
            <button @click='decrement'>-</button>
        </div>
    </template>

    <script>
        Vue.createApp({
            template: '#huyong',
            data() {
                return {
                    count: 1
                }
            },
            methods: {
                increment() {
                    this.count = this.count + 1
                },
                decrement() {
                    this.count = this.count - 1
                }
            }
        }).mount('#app')
    </script>
</body>

</html>